export default {
    navto (e) {
		console.log(e)
		let data = {}
		let url = e.currentTarget.dataset.url
        if(e !== undefined){
        	data = e.currentTarget.dataset
        }
        let p = "?"
        for (var i in data){
			if( i === 'eventOpts')continue;
			if( i === 'eventParams')continue;
			if( i === 'url')continue;
			p = p + (p === "?"?'':'&') + i + '=' + data[i]
        }
        console.log(e)
        uni.navigateTo({
            url: url + p
        });
    },
    goto (url,e) {
		console.log(e)
		let data = {}
		if(e !== undefined){
			data = e.currentTarget.dataset
		}
		console.log(data)
		let p = ""
		for (var i in data){
		// console.log(i)
			if( i === 'eventOpts')continue;
			if( i === 'eventParams')continue;
			p = p + (p === ""?'?':'&') + i + '=' + data[i]
		}
		console.log(url + p)
        uni.navigateTo({
            url: url + p
        });
    },
    gointo (url,data) {
        uni.redirectTo({
            url: url
        });
    },
    goback (delta) {
		if(delta == undefined)delta = 1
        uni.navigateBack({
            delta: delta
        });
    },
    gohome () {
		uni.switchTab({
		    url: '/pages/wuliu/index/index'
		});
    }
}
